package chap4.Task1;

import java.util.Scanner;

public class Task9 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("输入一个数字:");
        int money = input.nextInt();
        int a, b, c, d, e, f, g;
        int i = 0;
        for (a = 0; a <= money; a += 100) {
            for (b = 0; b <= money; b += 50) {
                for (c = 0; c <= money; c += 20) {
                    for (d = 0; d <= money; d += 10) {
                        for (e = 0; e <= money; e += 5) {
                            for (f = 0; f <= money; f += 2) {
                                for (g = 0; g <= money; g++) {
                                    if (a + b + c + d + e + f + g == money) {
                                        i++;
                                        System.out.println(a / 100 + "个100，" + b / 50 + "个50，" + c / 20 + "个20，" + d / 10 + "个10，" + e / 5 + "个5，" + f / 2 + "个2，" + g + "个1");
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        System.out.println("\n一共有" + i + "种组合");
    }
}
